package com.demo.springboot.service;

import com.demo.springboot.dao.NewsMapper;
import com.demo.springboot.entity.News;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class NewsServiceImpl implements NewsService {

    @Autowired
    NewsMapper newsMapper;

    @Override
    public News findById(Integer id) {
        return newsMapper.selectById(id);
    }

    @Override
    public int insertARecord(News news) {
        return newsMapper.insertNews(news);
    }
}
